1. Field of the Invention
The present invention relates to a network communication technology. Particularly, the invention relates to a routing device.
2. Description of Related Art
With the rapid spread of the Internet, a number of Public Internet Protocol address (public IP address) is insufficient due to rapidly emerging network users under the architecture of Internet Protocol Version 4 (IPv4). Therefore, ever since concepts of Private Network, Enterprise Intranet or Virtual Private Network are proposed, private network nowadays is widely used by organizations and institution everywhere.
Generally, in a private network, hosts can communicate with each other through customized Private Internet Protocol address (private IP address), in which a common private IP address may be, for example, an IP address with the first two digits being “192.168” (e.g., 192.168.1.101) or an IP address with first digit being “10” (e.g., 10.1.2.3). For communication to the outside, the hosts in the private network may be easily connected to the Internet by using the same public IP address through a NAT Server or a router with a Network Address Translation (NAT) feature.
For instance, FIG. 1 is a schematic view illustrating a network architecture composed by a plurality of private networks in conventional art. Referring to FIG. 1, private networks 100 to 120 is respectively composed by routing devices 10 to 12 and hosts 101 to 103, 201-203 and 301 to 303, in which the routing devices 10 to 12 perform a NAT task on a network packet from the private networks 100 to 120 to the Internet 130 or from the Internet 130 to the private networks 100 to 120, respectively.
For instance, when the host 101 in the private network 100 intends to transmit a network packet to the Internet 130, once the network packet passes through the routing device 10, the routing device 10 may convert a source IP address and a source port number of the network packet respectively from a private IP address (e.g., 192.168.1.101) and a private port number (e.g., 254130) used by the host 110 into a public IP address (e.g., 59.120.x.x) and a public port number (e.g., 5812) used by an external Network Interface Card (NIC) of the routing device 10, records the private IP address (e.g., 192.168.1.101) and the private port number (e.g., 254130) of the host 110 corresponding to the public port number (e.g., 5812) with an index value and then transmits the network packet to the Internet 130.
Accordingly, when the routing device 10 receives a network packet from the Internet 130, the routing device 10 locates a corresponding index value according to the public port number (e.g., 5812) in the network packet, obtains the private IP address (e.g., 192.168.1.101) and the private port number (e.g., 254130), and relays the network packet to the host 101.
Although the NAT method as mentioned above may allow the network packet to be transmitted successfully between the private network and the Internet, it is still requires improvement in transmitting the network packet between a plurality of private networks. In other words, with respect to FIG. 1 as an example, when the host 101 intends to transmit a network packet to the host 201, the routing device 10 may not be able to locate the host 201 (this is because the host 201 uses the private IP address instead of the public IP address). Accordingly, how to enable the hosts in the plurality of private networks to communicate with each other, is indeed an issue to be studied and developed in the field.